package xyz.fefine;

/**
 * Created by feng_ on 2016/9/12.
 * 用于存放函数
 */
public class Function {
    protected ParameterList parameters;
    protected BlockStmnt body;
    protected Enviorment env;

    public Function(ParameterList parameters, BlockStmnt body, Enviorment env) {
        this.parameters = parameters;
        this.body = body;
        this.env = env;
    }

    public ParameterList getParameters() {
        return parameters;
    }

    public BlockStmnt getBody() {
        return body;
    }

    public Enviorment makeEnv() {
        return new NestedEnv(env);
    }

    @Override
    public String toString() {
        return "<Fun "+hashCode()+">";
    }
}
